﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WenSkin.Controls;

namespace WenSkinTest.UserControlAll
{
    public partial class UserControlPaging : WenUserControl
    {
        public UserControlPaging()
        {
            InitializeComponent();
        }

        private void wenButton1_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("A");
            dt.Columns.Add("B");
            dt.Columns.Add("C");

            for (int i = 0; i < 1080; i++)
            {
                dt.Rows.Add(i, $"000{(i + 1)}".PadLeft(3), "TEST");
            }
            wenDataTablePaging1.DataSource = dt;
            propertyGrid1.SelectedObject = wenDataTablePaging1;
        }

        private void wenDataTablePaging1_PagingPageChange(object sender, WenSkin.Controls.Paging.WenDataTablePaging.PagingPageChangeEventArgs e)
        {
            wenDataGridView1.DataSource = e.PagingPage.DataTable;
        }
    }
}
